package _11_整理题目._Spring基础原理._设计模式._04_适配器模式._播放器;

public class MusicPlayerAdapter implements MusicPlayer {

    private MyPlayer myPlayer;

    public MusicPlayerAdapter() {
        this.myPlayer = new MyPlayer();
    }

    @Override
    public void play(String type, String filename) {
        if (type.equals("mp3")) {
            this.myPlayer.playMp3(filename);
        } else if (type.equals("wma")) {
            this.myPlayer.playWma(filename);
        }
    }
}
